﻿@using Gfw.Stock.Base
@model IEnumerable<Gfw.Web.Models.Stock.BargainRecordModel>
@{
    ViewBag.Title = "交易查询";
    Layout = "~/Views/Shared/_LayoutContent.cshtml";
}
<table id="mytable">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.BargainType)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.ActualPrice)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.ActualCount)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.TotalPrice)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.BargainDate)
        </th>
       
    </tr>
    @foreach (var item in Model)
    {
        <tr>
            <td>
                @if(item.BargainType == (int)TradeTypeEnum.Buy)
                {
                    <span style="color: Green">买入</span>
                }
                else if(item.BargainType == (int)TradeTypeEnum.Sell)
                {
                      <span style="color:Red">卖出</span>
                }
                else if (item.BargainType == (int)TradeTypeEnum.Cancel)
                {
                  <span style="color:Yellow">撤单</span>
                }
                else
                {
                  <span>错误</span>
                }
               
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.ActualPrice)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.ActualCount)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.TotalPrice)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.BargainDate)
            </td>
        </tr>
    }
</table>
